package api

import (
	"github.com/EDDYCJY/go-gin-example/models"
	"github.com/EDDYCJY/go-gin-example/pkg/app"

	"github.com/gin-gonic/gin"
)

// 查询价格
func Handle_Get_price(context *gin.Context) {
	appG := app.Gin{C: context}
	// prices := []struct {
	// 	Name  string  `json:"name"`
	// 	Price float64 `json:"price"`
	// 	Id    string  `json:"id"`
	// }{
	// 	{Name: "VGPU1R9001@100G", Price: 2, Id: "fc8a55a5-b033-40da-aff0-bc29da36431e"},
	// 	{Name: "VGPU1R9001@150G", Price: 3, Id: "24c2f612-9bf2-45c5-9ec4-779b43e7fe6f"},
	// 	{Name: "VGPU1R9001", Price: 1, Id: "24c2f612-9bf2-45c5-9ec4-779b43e7fe6f"},
	// }

	var prices []*models.Price
	models.GetDB().Where(&models.Price{IsInactive: true}).Find(&prices)
	appG.ResponseSuccess(prices)
}
